<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <!-- <img class="outline-parent-bg" :src="publicUrls + 'free/style3/Level1outlineStyle1Bg.png'" alt="" /> -->
    <div class="border-hover-style" style="display: flex">
      <div class="content-parent">
        <img class="outline-parent-bg" :src="publicUrls + 'free/style3/Level2outlineStyle1Bg.webp'" alt="" />
        <div class="content" :class="{ content2: !props.info.value }">
          <div class="img-box" v-if="props.info.value" @click="ImgVisible = true">
            <img class="img-box-item1" :src="publicUrls + 'free/style3/Level2outlineStyle1xt.webp'" alt="" />
            <img class="img-box-item2" :src="publicUrls + 'free/style3/Level2outlineStyle1xt2.webp'" alt="" />
            <img class="img-box-item3" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
          </div>
          <div class="digitalShowroom-p" v-if="props.info.digitalShowroom && props.info.value">
            <!-- digitalShowroom -->
            <digitalShowroomIcon :url="props.info.digitalShowroom" />
          </div>
          <div class="title-box" v-html="textType(props.info.text)"></div>
          <p class="subtitle" >
            {{ props.info.subTitle }} 
          </p>
          <div class="solider-item-parent" v-if="!props.info.value">
            <div class="digitalShowroom-t" v-if="props.info.digitalShowroom">
              <!-- digitalShowroom -->
              <digitalShowroomIcon :url="props.info.digitalShowroom" />
            </div>
            <img class="solider-item" :src="publicUrls + 'free/style3/Level2outlineStyle1xt2.webp'" alt="" />
          </div>
          <div class="remarks1" v-if="props.info.value">
            <TextMax
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text" 
              :row="props.info.subTitle ? 4 : 6"
            ></TextMax>
          </div>
          <div class="remarks2" v-else>
            <TextMax
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="8"
            ></TextMax>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free3Style4',
});
</script>

<script setup lang="ts">
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style1.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax3.vue';
import { useProjectStore } from '@/store';

const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  position: relative;
  margin-right: 140px;
  margin-left: 80px;
  margin-top: 0;
  height: 100%;
}
.content-parent {
  display: flex;
  position: relative;
  width: 434px;
  height: 774px;
}
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 344px;
  height: 638px;
  margin-top: 68px;
  margin-left: 40px;
  z-index: 6;
  position: relative;
  .title-box {
    margin-top: 32px;
  }
  //   background-image: url(https://static.jiyi.show/free/style3/Level2outlineStyle1xt.png);
  //   background-size: 100% 100%;
  //   background-repeat: no-repeat;
}
.content2 {
  .title-box {
    margin-top: 40px;
    height: 64px;
  }
}
.outline-parent-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 434px;
  height: 774px;
}
.img-box {
  position: relative;
  width: 344px;
  height: 210px;
  overflow: hidden;
}
.img-box-item1 {
  position: absolute;
  top: 0;
  left: 0;
  width: 344px;
  height: auto;
  z-index: 6;
}
.img-box-item2 {
  position: absolute;
  bottom: 0;
  left: 6px;
  width: 332px;
  height: auto;
  z-index: 7;
}
.img-box-item3 {
  width: 340px;
  height: 210px;
  object-fit: cover;
  transition: all 0.3s;
}
.img-box:hover {
  .img-box-item3 {
    transform: scale(1.1);
  }
}
.title-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 192px;
  font-family: SourceBold;
  font-size: 24px;
  color: #2f1b16;
  line-height: 32px;
  text-align: center;
  :deep(p) {
    font-family: SourceBold;
    font-size: 24px;
    color: #2f1b16;
    line-height: 32px;
    text-align: center;
    height: 32px;
  }
}
.subtitle {
  width: 270px;
  height: 48px;  
  font-family: SourceMedium;
  font-size: 18px;  
  color: #2f1b16;
  line-height: 24px; 
  text-align: center; 
  margin-top: 16px;
  opacity: 0.5;
}
.solider-item-parent {
  position: relative;
  width: 332px; 
  height: auto;
  margin: 0 auto;
  margin-top: 24px;
}
.digitalShowroom-t {
  width: 46px;
  height: 46px;
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
}
.solider-item {
  width: 332px;
  height: auto;
}
.remarks1 {
  width: 280px;
  margin-top: 40px;
}
.remarks2 {
  width: 280px;
  margin-top: 72px;
}
.digitalShowroom-p {
  position: relative;
  width: 46px;
  height: 46px;
  margin-top: -42px;
  z-index: 15;
}
</style>